﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace RiskMan.Models
{
    /// <summary>
    /// Table quik - table orders
    /// </summary>
    public class OrderModel : INotifyPropertyChanged
    {
        #region private
        private String _account;
        private String _seccode;
        private long _number;
        private String _operation;
        private int _ostCount;
        private Double _price;
        private int _count;
        private String _status;
        private DateTime _time;
        private String _clientCode;
        private int _tid; 
        #endregion


        #region public
        /// <summary>
        /// счет
        /// </summary>
        public String Account
        {
            get { return _account; }
            set
            {
                if (_account != value)
                {
                    _account = value;
                    RaisePropertyChanged("Account");
                }
            }
        }

        /// <summary>
        /// код инструмента
        /// </summary>
        public String Seccode
        {
            get { return _seccode; }
            set
            {
                if (_seccode != value)
                {
                    _seccode = value;
                    RaisePropertyChanged("Seccode");
                }
            }
        }

        /// <summary>
        /// номер заявки
        /// </summary>
        public long Number
        {
            get { return _number; }
            set
            {
                if (_number != value)
                {
                    _number = value;
                    RaisePropertyChanged("Number");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public String Operation
        {
            get { return _operation; }
            set
            {
                if (_operation != value)
                {
                    _operation = value;
                    RaisePropertyChanged("Operation");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public int OstCount
        {
            get { return _ostCount; }
            set
            {
                if (_ostCount != value)
                {
                    _ostCount = value;
                    RaisePropertyChanged("OstCount");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Double Price
        {
            get { return _price; }
            set
            {
                if (_price != value)
                {
                    _price = value;
                    RaisePropertyChanged("Price");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public int Count
        {
            get { return _count; }
            set
            {
                if (_count != value)
                {
                    _count = value;
                    RaisePropertyChanged("Count");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public String Status
        {
            get { return _status; }
            set
            {
                if (_status != value)
                {
                    _status = value;
                    RaisePropertyChanged("Status");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public DateTime Time
        {
            get { return _time; }
            set
            {
                if (_time != value)
                {
                    _time = value;
                    RaisePropertyChanged("Time");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public String ClientCode
        {
            get { return _clientCode; }
            set
            {
                if (_clientCode != value)
                {
                    _clientCode = value;
                    RaisePropertyChanged("ClientCode");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public int Tid
        {
            get { return _tid; }
            set
            {
                if (_tid != value)
                {
                    _tid = value;
                    RaisePropertyChanged("Tid");
                }
            }
        } 
        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
        //public String Account { get; set; }
        //public String Seccode { get; set; }
        //public long Number { get; set; }
        //public String Operation { get; set; }
        //public int OstCount { get; set; }
        //public Double Price { get; set; }
        //public int Count { get; set; }
        //public String Status { get; set; }
        //public DateTime Time { get; set; }
        //public String ClientCode { get; set; }
        //public int Tid { get; set; }
    }
}
